package JAVASE518;

import java.util.Random;

public class JAVAredpacket {
    public static void main(String[] argc){
        int[] arr={2,588,888,1000,10000};
        Random r=new Random();
        int[] arr1=new int[5];
        for (int i = 0; i < arr.length; ) {
            boolean flag=true;
            int index = r.nextInt(5);
            int j=0;
            for(;j<arr1.length;j++){
                if(arr[index]==arr1[j]){
                    flag=false;
                }
            }
            if(flag){
                arr1[i]=arr[index];
                i++;
            }
        }
        for (int i = 0; i < arr1.length; i++) {
            System.out.println(arr1[i]);
        }
    }
}